<?php

namespace app\common\helper;

use PhpOffice\PhpWord\Exception\CopyFileException;
use PhpOffice\PhpWord\Exception\CreateTemporaryFileException;
use PhpOffice\PhpWord\TemplateProcessor;

class WordHelper
{
    public function loadWord($doc)
    {
        try {
            return new TemplateProcessor($doc);
        } catch (CopyFileException|CreateTemporaryFileException $e) {
            throwError($e->getMessage());
        }
    }
}